using UnityEngine;
using System.Collections;

public class ModelDisplay : MonoBehaviour {
	
	public UICheckbox[] Models;
	
	int jobNum = 3;
	int sexNum = 2;
	int jobId = 1;
	int sexId = 0;
	
	Vector3 originalAnguler;
	Transform modelParent;
	
	void Start(){
		modelParent = Models[0].transform.parent;
		originalAnguler = modelParent.localEulerAngles;
		ShowModel();
	}
	
	void ShowModel(){
		int modelId = sexId * jobNum + jobId - 1;
		//Restore the model's anguler;
		modelParent.localEulerAngles = originalAnguler;
		
		Models[modelId].isChecked = true;
	}
	
	public void ShowJob(int id){
		jobId = id;
		
		ShowModel();
	}
	
	public void ShowSex(int id){
		sexId = id;
		
		ShowModel();
	}
}
